#include "maps.h"
#include "character.h"

#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/archive_exception.hpp>

using namespace fortress;

glyph::glyph()
{
	currentMap=0;
}

glyph::~glyph()
{

}

void glyph::setMap(map * newMap)
{
	currentMap = newMap;
}

bool glyph::isOnMap(map * compareMap) const
{
	return (currentMap == compareMap);
}

bool glyph::isOnMap(glyph * compareGlyph) const
{
	return (currentMap==(compareGlyph->currentMap));
}

char glyph::getGlyph() const
{
	return display;
}

TCODColor glyph::getColor() const
{
	return color;
}

void glyph::setGlyph(char newGlyph)
{
	display=newGlyph;
}

void glyph::setColor(TCODColor newColor)
{
	color.r=newColor.r;
	color.g=newColor.g;
	color.b=newColor.b;
}

void glyph::getCoords(int &getX, int &getY) const
{
	getX=x;
	getY=y;
}

bool glyph::exec(int, int)
{
	return 0;
}

void glyph::setCoords(int newX, int newY)
{
	x=newX;
	y=newY;
}

template<class Archive>
void glyph::serialize(Archive & ar, const unsigned int version)
{
	ar & display & color & x & y;
}

template void glyph::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive & ar, const unsigned int version);
template void glyph::serialize<boost::archive::text_oarchive>(boost::archive::text_oarchive & ar, const unsigned int version);
template void glyph::serialize<boost::archive::text_iarchive>(boost::archive::text_iarchive & ar, const unsigned int version);